<template>
  <div class="app-logo">
    <div class="app-logo-container">
      <span v-if="showLogo">
        <img alt="" class="mr-10px h-32px w-32px" src="/imgs/basic/cjui-vue.png" />
      </span>
      <span v-if="showLogoText" class="app-logo-text">
        <CjuiFontAnimationFault v-if="animateText" :text="underlineToHump(appStore.title)" />
        <span v-else class="app-logo-text">{{ underlineToHump(appStore.title) }}</span>
      </span>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { underlineToHump } from '@/utils/basic-common/common'
import { useAppStore } from '@/store/modules/app'

interface Props {
  showLogo?: boolean
  showLogoText?: boolean
  animateText?: boolean
}
const props = withDefaults(defineProps<Props>(), {
  showLogo: false,
  showLogoText: true,
  animateText: false
})

const appStore = useAppStore()
</script>

<style lang="scss" scoped>
.app-logo {
  display: inline-block;
}

.app-logo-container {
  display: flex;
}

.app-logo-text {
  font-size: 24px;
  font-weight: bold;
}
</style>
